﻿using ConfigService;
using LayeredConfig;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ICO2
{
    public static class LayeredConfigExp
    {
         public static void AddLayeredConfig(this IServiceCollection service,string fileName)
        {
            service.AddScoped(typeof(IConfigService), s => new IniFileConfigService(fileName));
            service.AddScoped<IConfigService, EnvVarConfigService>();
            service.AddScoped<ILayeredConfigInterface, LayereCfg>();
        }
    }
}
